package com.example.pipibee.pojo.param;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.*;
import java.io.Serializable;

/**
 * 插入_住院病案_主表_的参数类
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class DoctorInsertParam implements Serializable {

    @NotEmpty(message = "添加失败，请填写患者姓名！")
    private String name;

    @NotEmpty(message = "添加失败，请填写患者生日！")
    @Pattern(regexp = "^\\d{4}-\\d{2}-\\d{2}$", message = "添加失败，请正确填写患者生日！")
    private String birthday;

    @NotNull(message = "添加失败，请填写患者性别！")
    @Min(value = 0, message = "添加失败，患者性别的值最小为0！")
    @Max(value = 9, message = "添加失败，患者性别的值最大为9！")
    private Integer gender;

    @NotEmpty(message = "添加失败，请填写患者身份证号！")
    @Pattern(regexp = "^[1-9]\\d{5}(18|19|20|(3\\d))\\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$", message = "添加失败，请正确填写身份证！")
    private String idCard;

    @NotNull(message = "添加失败，请填写患者血型！")
    @Min(value = 0, message = "添加失败，患者血型的值最小为0！")
    @Max(value = 9, message = "添加失败，患者血型的值最大为9！")
    private Integer bloodType;

    @NotEmpty(message = "添加失败，请填写患者症状！")
    private String symptoms;

    @NotEmpty(message = "添加失败，请填写住院医师！")
    private String doctor;

    @NotNull(message = "添加失败，请填写入院方式！")
    @Min(value = 1, message = "添加失败，患者入院方式的值最小为1！")
    @Max(value = 9, message = "添加失败，患者入院方式的值最大为9！")
    private Integer admissionMethod;

    @NotNull(message = "添加失败，请填写出院方式！")
    @Min(value = 0, message = "添加失败，患者出院方式的值最小为0！")
    @Max(value = 9, message = "添加失败，患者出院方式的值最大为9！")
    private Integer dischargeMethod;


}
